Skip to content

bug: fix duplicate dependency in effective model (fixes #2532)#2554

Merged
gnodet merged 2 commits intoapache:masterfrom
gnodet:fix-dup-dependency
Jul 2, 2025
Merged

bug: fix duplicate dependency in effective model (fixes #2532)#2554
gnodet merged 2 commits intoapache:masterfrom
gnodet:fix-dup-dependency

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Jul 2, 2025

This PR fixes #2532 where a project POM installation may fail.
This only happens if the same dependency is somehow defined once in a regular way and another time with a property placeholder. The reason is that the deduplication is wrongly done before interpolation.

Fixes #2532

@gnodet gnodet added bug Something isn't working backport-to-4.0.x labels Jul 2, 2025
… model fix

- Add MavenITgh2532DuplicateDependencyEffectiveModelTest to verify the fix
- Test reproduces the scenario where property placeholders in dependency
  coordinates caused duplicate dependency errors after interpolation
- Verifies that deduplication now happens after interpolation as expected
- Add test to TestSuiteOrdering for proper execution order
@gnodet gnodet merged commit 7ac568b into apache:master Jul 2, 2025
19 checks passed
@github-actions github-actions bot added this to the 4.1.0 milestone Jul 2, 2025
@gnodet
Copy link
Contributor Author

gnodet commented Jul 2, 2025

💚 All backports created successfully

Status Branch Result
maven-4.0.x

Questions ?

Please refer to the Backport tool documentation

gnodet added a commit to gnodet/maven that referenced this pull request Jul 2, 2025
…pache#2554)

* bug: fix duplicate dependency in effective model (fixes apache#2532)

* Add integration test for apache#2532 duplicate dependency effective model fix

- Add MavenITgh2532DuplicateDependencyEffectiveModelTest to verify the fix
- Test reproduces the scenario where property placeholders in dependency
  coordinates caused duplicate dependency errors after interpolation
- Verifies that deduplication now happens after interpolation as expected
- Add test to TestSuiteOrdering for proper execution order

(cherry picked from commit 7ac568b)
gnodet added a commit that referenced this pull request Jul 2, 2025
#2556)

* bug: fix duplicate dependency in effective model (fixes #2532)

* Add integration test for #2532 duplicate dependency effective model fix

- Add MavenITgh2532DuplicateDependencyEffectiveModelTest to verify the fix
- Test reproduces the scenario where property placeholders in dependency
  coordinates caused duplicate dependency errors after interpolation
- Verifies that deduplication now happens after interpolation as expected
- Add test to TestSuiteOrdering for proper execution order

(cherry picked from commit 7ac568b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-4.0.x bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fail with "duplicate dependency" since 4.0.0-rc3

2 participants